<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<!--
表单
堆叠表单 设置了 .form-control类的input和textarea 元素都可以获取到正确的表单样式
每个 form-label 元素必须包含在每个 .form-group 元素内。
复选框 有不同的标记 .form-check 类的容器元素包围 复选框和单选按钮。
.form-check-label 类用于设置复选框和单选按钮的文本。
.form-check-inline 类用于将复选框和单选按钮放置在同一行。
.form-check-input 类用于设置复选框和单选按钮的样式。
表单尺寸
    .form-control-lg 类用于创建大尺寸表单。
    .form-control-sm 类用于创建小尺寸表单。
    .form-control 输出控件大小
选项大小
<select class="form-select form-select-lg">
<select class="form-select">
<select class="form-select form-select-sm">

-->
<body>
<div class="container-fluid mt-3">
    <form>
        <div class="mb-3 mt-3">
            <label for="email" class="form-label">电子邮件:</label>
            <input type="email" class="form-control" id="email" placeholder="请输入电子邮件地址" name="email">
        </div>
        <div class="mb-3">
            <label for="pwd" class="form-label">密码:</label>
            <input type="password" class="form-control" id="pwd" placeholder="请输入密码" name="pswd">
        </div>
        <div class="form-check-inline mb-3">
            <label class="form-check-label">
                <input type="checkbox" class="form-check-input" name="remember">记住我
            </label>
        </div>
        <br>
        <button type="submit" class="btn btn-primary">提交</button>
        <br>
        <div class="container mt-3">
            <label for="comment">评论:</label>
            <textarea class="form-control" rows="5" id="comment" name="text"></textarea>
        </div>
        <br>
        <div class="container mt-3">
            <h5>表单元素并排显示 使用.row 和.col</h5>
            <form>
                <div class="row">
                    <div class="col">
                        <label>
                            <input type="text" class="form-control" placeholder="请输出电子邮箱地址:" name="email">
                        </label>
                    </div>
                    <div class="col">
                        <label>
                            <input type="password" class="form-control" placeholder="请输入密码" name="pswd">
                        </label>
                    </div>
                </div>
            </form>
        </div>
        <div class="container mt-3">
            <h5>表单控件大小</h5>
            <p>使用 disabled属性或readonly属性禁用输入字段</p>
            <input type="text" class="form-control-lg" placeholder="大型输入表单控件">
            <input type="text" class="form-control" placeholder="普通输入表单控件" disabled>
            <input type="text" class="form-control-sm" placeholder="小型输入表单控件" readonly>
            <p>纯文本输入 使用.form-control-plaintext类 来设置没有边框的输入字段的样式,但保留适当的外边距和内边距</p>
            <input type="text" class="form-control-plaintext" placeholder="纯文本输入">
            <input type="text" class="form-control" placeholder="普通输入控件">
            <p>拾色器</p>
            如需正确的使用拾色器,请使用.form-control-color类</p>
            <input type="color" class="form-control form-control-color" id="exampleColorInput" value="#563d7c"
                   title="选择颜色">
        </div>
    </form>
    <br>
    <div class="container mt-3">
        <h5>选择菜单</h5>
        <p>使用 .form-select 类来创建选择菜单 将select 元素</p>
        <p> disabled 属性禁用选择菜单</p>
        <form action="/action_page.php">
            <label for="sel1" class="form-label">选择菜单(选择一项):</label>
            <select name="sellist1" id="sel1" class="form-select form-select-lg">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
            </select>
            <br>
            <label for="sel2" class="form-label">多选菜单(按住ctrl或shift 或者用鼠标拖动)可选择多个</label>
            <select multiple name="sellist2" id="sel2" class="form-select form-select-sm">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
            </select>
            <button type="submit" class="btn btn-primary mt-3"></button>
        </form>
    </div>
    <br>
    <div class="container mt-3">
        <h5>数据列表</h5>
        <form action="/action_page.php">
            <label for="browser" class="form-label">请从列表中选择你的浏览器:</label>
            <br>
            <input type="form-control" list="browsers" id="browser" name="browser">
            <datalist id="browsers">
                <option value="Edge">
                <option value="Firefox">
                <option value="Chrome">
                <option value="Opera">
                <option value="Safari">
            </datalist>
            <br>
            <button type="submit" class="btn btn-primary mt-3">提交</button>
        </form>
    </div>
</div>
</body>
</html>